package com.livepass.android.girlspicks.adapters;

import java.util.HashMap;
import java.util.List;

import com.livepass.android.girlspicks.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class PushMeassageAdapter extends ArrayAdapter<HashMap<String, String>> {

    private LayoutInflater inflater;
    private List<HashMap<String, String>> mList;

    public PushMeassageAdapter(Context context, List<HashMap<String, String>> list) {
        super(context, R.layout.list_clumns, list);
        inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mList = list;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = inflater.inflate(R.layout.list_clumns, null);
        HashMap<String, String> map = mList.get(position);
        TextView titleTv = (TextView) convertView.findViewById(R.id.list_clumns_title);
        titleTv.setText(map.get("mid"));
        TextView messageTv = (TextView) convertView.findViewById(R.id.list_clumns_message);
        messageTv.setText(map.get("alert"));
        convertView.setTag(map);
        return convertView;
    }

}
